home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
jcool01.zip
/
EX6_8.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-28
|
1KB
|
31 lines
//
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//
#include <cool/Queue.h> // COOL Queue class
#include <cool/Random.h> // COOL Random number class
#include <cool/Queue.C>
int main (void) {
CoolQueue<double> q1; // CoolQueue of default size
CoolRandom r (SIMPLE, 1, 3.0, 9.0); // Simple CoolRandom generator
for (int i = 0; i < 5; i++) // Put five CoolRandom numbers
q1.put (r.next ()); // into the CoolQueue
cout << q1 << "\n"; // Output CoolQueue elements
for (q1.reset(); q1.next(); ) // For each element in CoolQueue
if (q1.value() < 4.5) // If less than tolerance
q1.remove (); // Remove from CoolQueue
cout << q1 << "\n"; // Output CoolQueue elements
return (0);
}